use std::io;
use std::{fs};

fn main() {
    println!("please copy the target folder path!");

    let mut target_path = String::new();

    io::stdin().read_line(&mut target_path)
        .expect("Failed to read line!");

    println!("");

    let path = target_path.trim().to_string();

    for entry in fs::read_dir(path).expect("Failed to read the folder.") {
        if let Ok(entry) = entry {
            let file = entry.path();
            let filename = file.to_str().unwrap().split('\\');
            let siglefilename = filename.last().expect("error!");
            println!("{}",siglefilename);
        }
    }

    println!("");

    println!("done! please press enter to close.");
    let mut command = String::new();

    io::stdin().read_line(&mut command)
        .expect("Failed to read line!");
}
